#ifndef SLIDERFORM_H
#define SLIDERFORM_H

#include <QWidget>

namespace Ui {
class sliderForm;
}

class sliderForm : public QWidget
{
    Q_OBJECT

public:
    explicit sliderForm(QWidget *parent = nullptr);
    ~sliderForm();

    void setProgress(float progress);

    float progress() const;

    void updateProgressBar();
signals:
    // 用户拖动
    void progressChanged(float progress);

    void progressChangeFinished(float progress);

private:
    void mousePressEvent(QMouseEvent *event);
    void resizeEvent(QResizeEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

private:
    Ui::sliderForm *ui;
    bool movestate;
    float currIndex;
};

#endif // SLIDERFORM_H
